﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<title>测试图片上传</title>
	<style type="text/css">
		form { padding: 10px; background: #f5f5f5; border: 1px solid #EEEEEE; }
		input { padding: 10px; border: 1px solid #ccc; }
	</style>
</head>
<body>
<div>上传设计图测试</div>
<form action="/api/admin/maker/upload" method="post" enctype="multipart/form-data">
	<input type="file" name="image"/>
	<input type="submit" value="上传"/>
</form>
<br/>
<div>测试跨域 <span id="cors"></span></div>
</body>
</html>


<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
	(function(){
		loginInfo();
	})();
	function loginInfo(){
		var cors = $('#cors');
		$.ajax({
			type: 'post',
			url: 'http://www.gsai.com/api/admin/info',
			data: {},
			success: function (res) {
				console.log(res);
				cors.html('<br/><b>没有跨域</b>');
			},
			error: function() {
				cors.html('<br/><b style="color: red;">跨域报错辣</b>');
				console.log('错误啦');
			}
		});
	}
</script>